/*
//   Copyright 2008 Dear Soft(http://dear-soft.com)
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.
 */
package com.dear.soft.components.demo;

import javax.swing.JComponent;

import com.dear.soft.components.properties.Category;
import com.dear.soft.components.properties.PropertiesPanel;
import com.dear.soft.components.properties.PropertiesTableModel;
import com.dear.soft.components.properties.PropertyDescriptor;

public class Properties implements DemoPanel {

	public JComponent getGui() {
		return new PropertiesPanel(demoProperties());
	}

	public static final PropertiesTableModel demoProperties() {
		Category first = new Category("Fruits", "Fruiits bucket");
		first.add(new PropertyDescriptor("Apple", "Big red apple", "RED"));
		first.add(new PropertyDescriptor("Orange", "Juicy orange", "ORANGE"));
		first.add(new PropertyDescriptor("Plum", "Big plum", "BLUE"));
		first.add(new PropertyDescriptor("Water Melon", "Summer water melon",
				"GREEN"));
		first.expand();
		Category second = new Category("Sport", "For funs");
		second.add(new PropertyDescriptor("Football", "Outdor sport", "BALL"));
		second.add(new PropertyDescriptor("Hockey", "Winter sport", "PUCK"));
		second.add(new PropertyDescriptor("Snooker", "Show sport", "CUE"));
		second.expand();
		PropertiesTableModel result = new PropertiesTableModel();
		result.addCategory(first);
		result.addCategory(second);
		return result;
	}

	@Override
	public String getLabel() {
		return "Properties";
	}
}
